package com.kayt.cyberBar.cpublic.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kayt.cyberBar.common.PageData;
import com.kayt.cyberBar.common.ServerResponse;
import com.kayt.cyberBar.cpublic.business.entity.po.CPublicTaskType;
import com.kayt.cyberBar.cpublic.business.entity.req.vo.PublicTaskTypeReqVO;
import com.kayt.cyberBar.cpublic.business.entity.rsp.vo.PublicTaskTypeRspVO;
import com.kayt.cyberBar.cpublic.business.server.IPublicTaskTypeServer;
import com.kayt.cyberBar.cpublic.business.service.IPublicTaskTypeService;

@Service("publicTaskTypeService")
public class PublicTaskTypeServiceImpl implements IPublicTaskTypeService{
	@Autowired
	private IPublicTaskTypeServer publicTaskTypeServer;
	@Override
	public ServerResponse<PageData<PublicTaskTypeRspVO>> getTaskTypeList() {
		PageData<CPublicTaskType> taskTypePageData = publicTaskTypeServer.get_taskType_list();
		return publicTaskTypeServer.assemble_result_list(taskTypePageData);
	}

	@Override
	public ServerResponse<PublicTaskTypeRspVO> addTaskType(PublicTaskTypeReqVO taskTypeReqVO) {
		CPublicTaskType taskType = publicTaskTypeServer.add_TaskType(taskTypeReqVO);
		return publicTaskTypeServer.assemble_result(taskType);
	}

	@Override
	public ServerResponse<PublicTaskTypeRspVO> updateTaskType(PublicTaskTypeReqVO taskTypeReqVO) {
		CPublicTaskType taskType = publicTaskTypeServer.mod_taskType(taskTypeReqVO);
		return publicTaskTypeServer.assemble_result(taskType);
	}

	@Override
	public ServerResponse<String> deleteTaskType(String taskTypeId) {
		Integer result = publicTaskTypeServer.del_taskType(taskTypeId);
		return publicTaskTypeServer.assemble_result_string(result);
	}
}
